import request from '@/http/request'

export function getaAddressAdd(data) {
  return request({
    url: '/address/add',
    method: 'post',
    data
  })
}

export function getAddressDetail() {
  return request({
    url: '/address/getDetail',
    method: 'get'
  })
}

export function getAddressList() {
  return request({
    url: '/user/get_my_address',
    method: 'get'
  })
}

// 设为默认地址
export function getAddressSetDetail(addressId) {
  return request({
    url: `/address/set_default?addressId=${addressId}`,
    method: 'get',
  })
}

// 删除地址
export function getAddressRemove(addressId) {
  return request({
    url: `/address/remove?addressId=${addressId}`,
    method: 'get'
  })
}


// 更新地址
export function getAddressUpdate(data) {
  return request({
    url: `/address/update`,
    method: 'post',
    data
  })
}